# import keyword
#
# print(keyword.kwlist)
import time
import asyncio
import aiohttp

async def fun1():
	await asyncio.sleep(5)
	return "fun1_result"


async def fun2():
	await asyncio.sleep(5)
	return "fun2_result"


async def main():
	task1 = asyncio.create_task(fun1())
	task2 = asyncio.create_task(fun2())

	r1 = await task1
	r2 = await task2
	print(r1, r2)
asyncio.run(main())

print("the end")





# async def fun1():
# 	async with aiohttp.ClientSession() as session:
# 		async with session.get('http://httpbin.org/get?age=10') as response:
# 			return await response.json()
#
#
# async def fun2():
# 	async with aiohttp.ClientSession() as session:
# 		async with session.get('http://httpbin.org/get?age=20') as response:
# 			return await response.json()
#
# async def main():
#
# 	results = await asyncio.gather(*[asyncio.create_task(fun1()), asyncio.create_task(fun2())])
# 	for r in results:
# 		print(r)
#
# asyncio.run(main())
#
# print("the end")
#






# async def fun(url):
# 	async with aiohttp.ClientSession() as session:
# 		async with session.get(url) as response:
# 			return await response.json()
#
# async def main():
# 	urls = [f"http://httpbin.org/get?age={i}" for i in range(100)]
# 	results = await asyncio.gather(*[ asyncio.create_task(fun(url))    for url in urls ])
# 	for r in results:
# 		print(r)
#
# asyncio.run(main())
#
# print("the end")








